package com.chinapost.po;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Tdept entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "TDEPT", schema = "WDZY")
public class Tdept implements java.io.Serializable {

	// Fields

	private String cid;
	private Tdept tdept;
	private String cname;
	private Integer cseq;
	private Timestamp ccreatedate;
	private Timestamp cmodifydate;
	private Set<Twdry> twdries = new HashSet<Twdry>(0);
	private Set<Tzxf> tzxfs = new HashSet<Tzxf>(0);
	private Set<Tywcb> tywcbs = new HashSet<Tywcb>(0);
	private Set<Twdxx> twdxxes = new HashSet<Twdxx>(0);
	private Set<Tfczy> tfczies = new HashSet<Tfczy>(0);
	private Set<Tuser> tusers = new HashSet<Tuser>(0);
	private Set<Twdsb> twdsbs = new HashSet<Twdsb>(0);
	private Set<Tdept> tdepts = new HashSet<Tdept>(0);

	// Constructors

	/** default constructor */
	public Tdept() {
	}

	/** minimal constructor */
	public Tdept(String cid, String cname) {
		this.cid = cid;
		this.cname = cname;
	}

	/** full constructor */
	public Tdept(String cid, Tdept tdept, String cname, Integer cseq, Timestamp ccreatedate, Timestamp cmodifydate, Set<Twdry> twdries, Set<Tzxf> tzxfs, Set<Tywcb> tywcbs, Set<Twdxx> twdxxes, Set<Tfczy> tfczies, Set<Tuser> tusers, Set<Twdsb> twdsbs, Set<Tdept> tdepts) {
		this.cid = cid;
		this.tdept = tdept;
		this.cname = cname;
		this.cseq = cseq;
		this.ccreatedate = ccreatedate;
		this.cmodifydate = cmodifydate;
		this.twdries = twdries;
		this.tzxfs = tzxfs;
		this.tywcbs = tywcbs;
		this.twdxxes = twdxxes;
		this.tfczies = tfczies;
		this.tusers = tusers;
		this.twdsbs = twdsbs;
		this.tdepts = tdepts;
	}

	// Property accessors
	@Id
	@Column(name = "CID", unique = true, nullable = false, length = 36)
	public String getCid() {
		return this.cid;
	}

	public void setCid(String cid) {
		this.cid = cid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PID")
	public Tdept getTdept() {
		return this.tdept;
	}

	public void setTdept(Tdept tdept) {
		this.tdept = tdept;
	}

	@Column(name = "CNAME", nullable = false, length = 100)
	public String getCname() {
		return this.cname;
	}

	public void setCname(String cname) {
		this.cname = cname;
	}

	@Column(name = "CSEQ", precision = 5, scale = 0)
	public Integer getCseq() {
		return this.cseq;
	}

	public void setCseq(Integer cseq) {
		this.cseq = cseq;
	}

	@Column(name = "CCREATEDATE", length = 11)
	public Timestamp getCcreatedate() {
		return this.ccreatedate;
	}

	public void setCcreatedate(Timestamp ccreatedate) {
		this.ccreatedate = ccreatedate;
	}

	@Column(name = "CMODIFYDATE", length = 11)
	public Timestamp getCmodifydate() {
		return this.cmodifydate;
	}

	public void setCmodifydate(Timestamp cmodifydate) {
		this.cmodifydate = cmodifydate;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tdept")
	public Set<Twdry> getTwdries() {
		return this.twdries;
	}

	public void setTwdries(Set<Twdry> twdries) {
		this.twdries = twdries;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tdept")
	public Set<Tzxf> getTzxfs() {
		return this.tzxfs;
	}

	public void setTzxfs(Set<Tzxf> tzxfs) {
		this.tzxfs = tzxfs;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tdept")
	public Set<Tywcb> getTywcbs() {
		return this.tywcbs;
	}

	public void setTywcbs(Set<Tywcb> tywcbs) {
		this.tywcbs = tywcbs;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tdept")
	public Set<Twdxx> getTwdxxes() {
		return this.twdxxes;
	}

	public void setTwdxxes(Set<Twdxx> twdxxes) {
		this.twdxxes = twdxxes;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tdept")
	public Set<Tfczy> getTfczies() {
		return this.tfczies;
	}

	public void setTfczies(Set<Tfczy> tfczies) {
		this.tfczies = tfczies;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tdept")
	public Set<Tuser> getTusers() {
		return this.tusers;
	}

	public void setTusers(Set<Tuser> tusers) {
		this.tusers = tusers;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tdept")
	public Set<Twdsb> getTwdsbs() {
		return this.twdsbs;
	}

	public void setTwdsbs(Set<Twdsb> twdsbs) {
		this.twdsbs = twdsbs;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tdept")
	public Set<Tdept> getTdepts() {
		return this.tdepts;
	}

	public void setTdepts(Set<Tdept> tdepts) {
		this.tdepts = tdepts;
	}

}